From 45d650b13f6fd2841b273de29b66dcb60956a548 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 11 Sep 2007 10:29:44 +0000 Subject: [PATCH] GPX: links aren't wpt only; implement for trk and rte, too. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3000 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/gpx.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index bf9fcfd6b..514408c98 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -896,22 +896,6 @@ gpx_end(void *data, const XML_Char *xml_el) /* * Waypoint-specific tags. */ - case tt_wpt_url: - wpt_tmp->url = xstrdup(cdatastrp); - break; - case tt_wpt_urlname: - wpt_tmp->url_link_text = xstrdup(cdatastrp); - break; - case tt_wpt_link: { - char *lt = link_text; - if (lt) { - lt = xstrdup(lrtrim(link_text)); - } - - waypt_add_url(wpt_tmp, xstrdup(link_url), lt); - link_text = NULL; - } - break; case tt_wpt: waypt_add(wpt_tmp); logpoint_ct = 0; @@ -1095,6 +1079,29 @@ gpx_end(void *data, const XML_Char *xml_el) wpt_tmp->fix = fix_unknown; } break; + case tt_wpt_url: + case tt_trk_trkseg_trkpt_url: + case tt_rte_rtept_url: + wpt_tmp->url = xstrdup(cdatastrp); + break; + case tt_wpt_urlname: + case tt_trk_trkseg_trkpt_urlname: + case tt_rte_rtept_urlname: + wpt_tmp->url_link_text = xstrdup(cdatastrp); + break; + case tt_wpt_link: +//TODO: implement GPX 1.1 case tt_trk_trkseg_trkpt_link: +//TODO: implement GPX 1.1 case tt_rte_rtept_link: + { + char *lt = link_text; + if (lt) { + lt = xstrdup(lrtrim(link_text)); + } + + waypt_add_url(wpt_tmp, xstrdup(link_url), lt); + link_text = NULL; + } + break; case tt_unknown: end_something_else(); *s = 0; -- 2.30.2